import request from "@/utils/request";


export function login(data){
    return request({
        url:'/user/login',
        method: 'POST',
        params: data,
    })
}

export function getCode(key){
    return request({
        url:'/user/getCode',
        method: 'GET',
        params: { key },
    })
}

export function forgotPassword(data){
    return request({
        url:'/user/forgotPassword',
        method: 'POST',
        params: data,
    })
}



export function selectAllUser(data){
    return request({
        url:'/user/selectAllUser',
        method: 'GET',
        params: data,
    })
}

export function selectAllRole(data){
    return request({
        url:'/user/selectAllRole',
        method: 'GET',
        params: data
    })
}

export function addUser(data){
    return request({
        url:'/user/addUser',
        method: 'POST',
        data: data
    })
}


export function getRoleMenu(data){
    return request({
        url:'/user/getRoleMenu',
        method: 'GET',
        params: data
    })
}

export function getRole(data){
    return request({
        url:'/user/getRole',
        method: 'GET',
        params: data
    })
}

export function getUser(data){
    return request({
        url:'/user/getUser',
        method: 'GET',
        params: data
    })
}

export function updateUser(data){
    return request({
        url:'/user/updateUser',
        method: 'PUT',
        data: data
    })
}

export function updateUserStatus(data){
    return request({
        url:'/user/updateUserStatus',
        method: 'PUT',
        data: data
    })
}

export function updateUserPwd(data){
    return request({
        url:'/user/updateUserPwd',
        method: 'PUT',
        data: data
    })
}


export function deleteUser(data){
    return request({
        url:'/user/deleteUser/' + data,
        method: 'PUT',
    })
}

export function deleteRole(data){
    return request({
        url:'/user/deleteRole/' + data,
        method: 'PUT',
    })
}

export function selectAllMenu(data){
    return request({
        url:'/user/selectAllMenu',
        method: 'GET',
        params: data,
    })
}

export function selectMenu(data){
    return request({
        url:'/user/selectMenu',
        method: 'GET',
        params: data,
    })
}

export function selectRoleMenu(data){
    return request({
        url:'/user/selectRoleMenu',
        method: 'GET',
        params: data,
    })
}

export function addRoleMenu(data){
    return request({
        url:'/user/addRoleMenu',
        method: 'POST',
        data: data
    })
}

export function getUserRole(data){
    return request({
        url:'/user/getUserRole',
        method: 'GET',
        params: data
    })
}

export function addUserRole(data){
    return request({
        url:'/user/addUserRole',
        method: 'POST',
        data: data
    })
}

export function addRole(data){
    return request({
        url:'/user/addRole',
        method: 'POST',
        data: data
    })
}
